cobweb and staircase diagrams iteration